<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>登录页面</title>
		<link rel="stylesheet" href="http://unpkg.com/layui@2.6.8/dist/css/layui.css">
	</head>
	<body>
		<div style="padding: 60px;">
			<form class="layui-form" action="">
				<div class="layui-form-item">
					<label class="layui-form-label">用户名</label>
					<div class="layui-input-block">
						<input type="text" name="stu_name" required lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">密码</label>
					<div class="layui-input-block">
						<input type="password" name="pud" required lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
					</div>
				</div>

				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="formDemo">登录</button>
					</div>
				</div>

			</form>
		</div>
		<div style="display: none;">
			<input type="text" placeholder="用户名" /><br />
			<input type="password" placeholder="密码" /><br />
			<div href="5111190214js.html" id="commit"><button>登录</button></div>

		</div>

		<script src="http://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>

		<script src="http://unpkg.com/layui@2.6.8/dist/layui.js"></script>




		<script>
			//Demo
			layui.define(function() {
				var layer = layui.layer,
					form = layui.form,
					table = layui.table;

				//监听提交
				form.on('submit(formDemo)', function(data) {
					//layer.msg(JSON.stringify(data.field));
					console.log(data);
					if (data.field.stu_name != '4567') {
						layer.alert('用户名不存在', {
							icon: 2
						});
					} else if (data.field.pud != 'abc') {
						layer.alert('密码错误');
					} else {
						layer.alert('登录成功');
						window.location.href="5111190214js.html"
					}
					return false;
				});
			});
		</script>
		<!-- 
		<script>
			$(document).ready(function() {
				$("commit").click(function() {
					var name = $('[typer=text]').val();
					alert("段落被点击了。");
			
		</script>



		<script>
			layui.use('form', function() {
				var form = layui.form;

				//监听提交
				form.on('submit(formDemo)', function(data) {
					layer.msg(JSON.stringify(data.field));
					return false;
				});
			});
		</script> -->




		<!-- <script>
			layui.define(function() { // 需确保您的 layui.js 是引入的构建后的版本（即官网下载或 git 平台的发行版）
				//直接可得到各种内置模块
				var layer = layui.layer,
					form = layui.form,
					table = layui.table;

				//…
				layer.msg('Hello World');

				exports('index', {}); //注意，这里是模块输出的核心，模块名必须和 use 时的模块名一致
			});
		</script> -->



	</body>
</html>
